package SQL;
import student.CustomerUse;
import student.User;

import java.sql.SQLException;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * Author: 保护小周
 * Date: 2022-11-06
 * Time: 12:58
 */

public class Main {

    public static void main(String[] args) throws SQLException, ClassNotFoundException {
        Scanner in = new Scanner(System.in);

        System.out.println("欢迎来到登录界面！");
        boolean flag1 = true;
        while( flag1 ) {

            System.out.println("请输入账号：");
            String uname = in.nextLine(); //输入账号
            System.out.println("请输入密码：");
            String pad = in.nextLine();   //输入密码

            //登录判断
            boolean flag2 = User.register(uname, pad);

            if( flag2 ) {
                System.out.println("登录成功！");
                CustomerUse.function(); //功能实现
                flag1 = false;

            } else {
                System.out.println("登录失败！");
            }
        }
    }
}
